<html>
    <head>
        <meta charset="utf-8">
        <style>
            #app{
                width: 200px;
            }
        </style>
    </head>
    <body>
        <h1>Sciter的@sciter模块的使用</h1>
        <div#app>App</div>
        <div#demo>Demo</div>
    </body>
    <script type="module">
        import * as sciter from "@sciter";
        console.log("sciter",sciter);
        /**
         * sciter[object]$ :function $() {
    [native code]
}$$ :function $$() {
    [native code]
}decode :function decode() {
    [native code]
}devicePixels :function devicePixels() {
    [native code]
}encode :function encode() {
    [native code]
}loadLibrary :function loadLibrary() {
    [native code]
}off :function off() {
    [native code]
}on :function on() {
    [native code]
}printf :function printf() {
    [native code]
}uuid :function uuid() {
    [native code]
}
         * */
        // 3个版本信息
        console.log("quickjs",sciter.QUICKJS_VERSION)
        console.log("quickjs",sciter.REVISION)
        console.log("quickjs",sciter.VERSION)

        // dom操作 $,$$读取元素,$读取单个元素$$读取多个元素
        console.log("sciter.$",sciter.$("#app"));
        console.log("sciter.$$",sciter.$$("div"));

        // on注册事件
        sciter.$("#app").on("click",()=>{
            console.log("点击app");
        })
        // off 去掉注册事件

        // loadLibrary sqlite 实现本地模块加载
        // sqliteDemo.htm
        // devicePixels

        // https://sciter.com/forums/reply/68300/
        // devicePixels px像素转屏幕dpi
        let dpx = sciter.devicePixels("5px")
        console.log("dpx",dpx);
        
        // 生成唯一id
        let id = sciter.uuid();
        console.log("uuid",id);
    </script>
</html>